package hexagon.demo.controller;

import hexagon.security.core.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author XueguiYuan
 * @version 1.0 (created time: 2016/12/10).
 */
@RestController
@RequestMapping("/home")
public class HomeController {

    @GetMapping
    public List<User> index() {
        User u = new User();
        u.setUsername("test");
        u.save();

        return User.find.where()
                .eq("username", "test").findList();
    }
}
